package cn.chengpengper.seckill.order.application.service;

import cn.chengpengper.seckill.common.model.dto.SeckillOrderSubmitDTO;
import cn.chengpengper.seckill.common.model.message.ErrorMessage;
import cn.chengpengper.seckill.order.application.model.command.SeckillOrderCommand;
import cn.chengpengper.seckill.order.domain.model.entity.SeckillOrder;

import java.util.List;

/**
 * @author chengpeng.hu
 */
public interface SeckillOrderService {

    /**
     * 保存订单
     *
     * @param userId              用户ID
     * @param seckillOrderCommand 订单命令
     * @return 订单ID
     */
    Long saveSeckillOrder(Long userId, SeckillOrderCommand seckillOrderCommand);

    /**
     * 根据用户id获取订单列表
     *
     * @param userId 用户ID
     * @return 订单列表
     */
    List<SeckillOrder> getSeckillOrderByUserId(Long userId);

    /**
     * 根据商品ID查找订单列表
     *
     * @param goodsId 商品ID
     * @return 订单列表
     */
    List<SeckillOrder> getSeckillOrderByGoodsId(Long goodsId);

    void deleteOrder(ErrorMessage errorMessage);

    /**
     * 根据taskId userId goodsId查询订单
     *
     * @param orderTaskId
     * @param userId
     * @param goodsId
     * @return
     */
    SeckillOrderSubmitDTO getSeckillOrderSubmitDTOByTaskId(String orderTaskId, Long userId, Long goodsId);
}
